\(\int \frac {c+d x}{a+a \cosh (e+f x)} \, dx\) [113]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 18, antiderivative size = 49 \[ \int \frac {c+d x}{a+a \cosh (e+f x)} \, dx=-\frac {2 d \log \left (\cosh \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a f^2}+\frac {(c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f} \]

[Out]

-2*d*ln(cosh(1/2*f*x+1/2*e))/a/f^2+(d*x+c)*tanh(1/2*f*x+1/2*e)/a/f

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3399, 4269, 3556} \[ \int \frac {c+d x}{a+a \cosh (e+f x)} \, dx=\frac {(c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f}-\frac {2 d \log \left (\cosh \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a f^2} \]

[In]

Int[(c + d*x)/(a + a*Cosh[e + f*x]),x]

[Out]

(-2*d*Log[Cosh[e/2 + (f*x)/2]])/(a*f^2) + ((c + d*x)*Tanh[e/2 + (f*x)/2])/(a*f)

Rule 3399

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(2*a)^n, Int[(c
 + d*x)^m*Sin[(1/2)*(e + Pi*(a/(2*b))) + f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2
- b^2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4269

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Cot[e + f*x]/f), x
] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\int (c+d x) \csc ^2\left (\frac {1}{2} (i e+\pi )+\frac {i f x}{2}\right ) \, dx}{2 a} \\ & = \frac {(c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f}-\frac {d \int \tanh \left (\frac {e}{2}+\frac {f x}{2}\right ) \, dx}{a f} \\ & = -\frac {2 d \log \left (\cosh \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a f^2}+\frac {(c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.62 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.43 \[ \int \frac {c+d x}{a+a \cosh (e+f x)} \, dx=\frac {2 \cosh \left (\frac {1}{2} (e+f x)\right ) \left (-2 d \cosh \left (\frac {1}{2} (e+f x)\right ) \log \left (\cosh \left (\frac {1}{2} (e+f x)\right )\right )+f (c+d x) \sinh \left (\frac {1}{2} (e+f x)\right )\right )}{a f^2 (1+\cosh (e+f x))} \]

[In]

Integrate[(c + d*x)/(a + a*Cosh[e + f*x]),x]

[Out]

(2*Cosh[(e + f*x)/2]*(-2*d*Cosh[(e + f*x)/2]*Log[Cosh[(e + f*x)/2]] + f*(c + d*x)*Sinh[(e + f*x)/2]))/(a*f^2*(
1 + Cosh[e + f*x]))

Maple [A] (verified)

Time = 0.16 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.96

method result size
parallelrisch \(\frac {2 \ln \left (1-\tanh \left (\frac {e}{2}+\frac {f x}{2}\right )\right ) d +\left (\left (d x +c \right ) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )+d x \right ) f}{a \,f^{2}}\) \(47\)
risch \(\frac {2 d x}{a f}+\frac {2 d e}{a \,f^{2}}-\frac {2 \left (d x +c \right )}{a f \left (1+{\mathrm e}^{f x +e}\right )}-\frac {2 d \ln \left (1+{\mathrm e}^{f x +e}\right )}{a \,f^{2}}\) \(63\)

[In]

int((d*x+c)/(a+a*cosh(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

(2*ln(1-tanh(1/2*e+1/2*f*x))*d+((d*x+c)*tanh(1/2*e+1/2*f*x)+d*x)*f)/a/f^2

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 92 vs. \(2 (41) = 82\).

Time = 0.27 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.88 \[ \int \frac {c+d x}{a+a \cosh (e+f x)} \, dx=\frac {2 \, {\left (d f x \cosh \left (f x + e\right ) + d f x \sinh \left (f x + e\right ) - c f - {\left (d \cosh \left (f x + e\right ) + d \sinh \left (f x + e\right ) + d\right )} \log \left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right ) + 1\right )\right )}}{a f^{2} \cosh \left (f x + e\right ) + a f^{2} \sinh \left (f x + e\right ) + a f^{2}} \]

[In]

integrate((d*x+c)/(a+a*cosh(f*x+e)),x, algorithm="fricas")

[Out]

2*(d*f*x*cosh(f*x + e) + d*f*x*sinh(f*x + e) - c*f - (d*cosh(f*x + e) + d*sinh(f*x + e) + d)*log(cosh(f*x + e)
 + sinh(f*x + e) + 1))/(a*f^2*cosh(f*x + e) + a*f^2*sinh(f*x + e) + a*f^2)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 76 vs. \(2 (37) = 74\).

Time = 0.34 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.55 \[ \int \frac {c+d x}{a+a \cosh (e+f x)} \, dx=\begin {cases} \frac {c \tanh {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{a f} + \frac {d x \tanh {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{a f} - \frac {d x}{a f} + \frac {2 d \log {\left (\tanh {\left (\frac {e}{2} + \frac {f x}{2} \right )} + 1 \right )}}{a f^{2}} & \text {for}\: f \neq 0 \\\frac {c x + \frac {d x^{2}}{2}}{a \cosh {\left (e \right )} + a} & \text {otherwise} \end {cases} \]

[In]

integrate((d*x+c)/(a+a*cosh(f*x+e)),x)

[Out]

Piecewise((c*tanh(e/2 + f*x/2)/(a*f) + d*x*tanh(e/2 + f*x/2)/(a*f) - d*x/(a*f) + 2*d*log(tanh(e/2 + f*x/2) + 1
)/(a*f**2), Ne(f, 0)), ((c*x + d*x**2/2)/(a*cosh(e) + a), True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.45 \[ \int \frac {c+d x}{a+a \cosh (e+f x)} \, dx=2 \, d {\left (\frac {x e^{\left (f x + e\right )}}{a f e^{\left (f x + e\right )} + a f} - \frac {\log \left ({\left (e^{\left (f x + e\right )} + 1\right )} e^{\left (-e\right )}\right )}{a f^{2}}\right )} + \frac {2 \, c}{{\left (a e^{\left (-f x - e\right )} + a\right )} f} \]

[In]

integrate((d*x+c)/(a+a*cosh(f*x+e)),x, algorithm="maxima")

[Out]

2*d*(x*e^(f*x + e)/(a*f*e^(f*x + e) + a*f) - log((e^(f*x + e) + 1)*e^(-e))/(a*f^2)) + 2*c/((a*e^(-f*x - e) + a
)*f)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.35 \[ \int \frac {c+d x}{a+a \cosh (e+f x)} \, dx=\frac {2 \, {\left (d f x e^{\left (f x + e\right )} - d e^{\left (f x + e\right )} \log \left (e^{\left (f x + e\right )} + 1\right ) - c f - d \log \left (e^{\left (f x + e\right )} + 1\right )\right )}}{a f^{2} e^{\left (f x + e\right )} + a f^{2}} \]

[In]

integrate((d*x+c)/(a+a*cosh(f*x+e)),x, algorithm="giac")

[Out]

2*(d*f*x*e^(f*x + e) - d*e^(f*x + e)*log(e^(f*x + e) + 1) - c*f - d*log(e^(f*x + e) + 1))/(a*f^2*e^(f*x + e) +
 a*f^2)

Mupad [B] (verification not implemented)

Time = 1.77 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.08 \[ \int \frac {c+d x}{a+a \cosh (e+f x)} \, dx=\frac {2\,d\,x}{a\,f}-\frac {2\,\left (c+d\,x\right )}{a\,f\,\left ({\mathrm {e}}^{e+f\,x}+1\right )}-\frac {2\,d\,\ln \left ({\mathrm {e}}^{f\,x}\,{\mathrm {e}}^e+1\right )}{a\,f^2} \]

[In]

int((c + d*x)/(a + a*cosh(e + f*x)),x)

[Out]

(2*d*x)/(a*f) - (2*(c + d*x))/(a*f*(exp(e + f*x) + 1)) - (2*d*log(exp(f*x)*exp(e) + 1))/(a*f^2)